
import request from '@/utils/request'

// export function getEmployees() {
// //   return request({
// //     url: '/sys/user/simple',
// //     method: 'get'
// //   })
//   return request.get('/sys/user/simple')
// }

export const getEmployees = () => request.get('/sys/user/simple')

// 员工列表
export const getEmployeeList = (page, size) => request.get('/sys/user', {
  params: {
    page,
    size
  }
})

export function delEmployee(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

export function addEmployee(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}

export function importEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

export function updatEmplotess(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
